#[allow(dead_code)]
pub fn test06() {
    let mut vec = vec![1, 2, 3, 4, 5];
    // loop {
    //     match vec.pop() {
    //         Some(val) => println!("{}", val),
    //         _ => break,
    //     }
    // }
    while let Some(val) = vec.pop() {
        println!("{}", val);
    }
}

#[allow(dead_code)]
pub fn test05() {
    let sum: i32 = (1..=100).sum();
    println!("sum={}", sum);
}
#[allow(dead_code)]
pub fn test04() {
    let mut sum = 0;
    for i in 1..=100 {
        sum += i;
    }
    println!("sum={sum}")
}
#[allow(dead_code)]
pub fn test03() {
    let mut count = 1;
    let mut sum = 0;
    while count <= 100 {
        sum += count;
        count += 1;
    }
    println!("sum={}", sum);
}

#[allow(dead_code)]
pub fn test02() {
    let mut count = 1;
    let mut sum = 0;
    loop {
        sum += count;
        count += 1;
        if count > 100 {
            break;
        }
    }
    println!("sum={}", sum);
}

#[allow(dead_code)]
pub fn test01() {
    let age = 1;
    if age > 18 {
        println!("You are an adult!");
    } else {
        println!("You are not an adult!");
    }

    if age < 1 {
        println!("You are a baby!");
    } else if age < 3 {
        println!("You are a toddler.");
    } else {
        println!("You are an adult.");
    }
}